<?php
relid         integer,
gtos          varchar(20),
stog          varchar(20),
guardsex      char(1),
studsex       char(1))

	class relation
	{
		private $relid, $gtos, $stog, $guardsex, $studsex;

// Read record of a guardian by User ID

		public function __construct($id)
		{
			include('config.php');
			$dsn = $dbtype.'://'.$user.':'.$pass.'@'.$host.'/'.$db_name;
			$db=DB::connect($dsn);
			if (DB::isError($this->db)) {
				die ($db->getMessage());
			}
			$db->setFetchMode(DB_FETCHMODE_ASSOC);
			$sql='select * from guardstud where relid='.$id;
			$result=$db->query($sql);
			if (DB::isError($result)) {
				die ($result->getMessage());
			}
			$row=$result->fetchRow();
			if($result->numRows()!=0)
			{
				$this->relid=$row['relid'];
				$this->gtos=$row['gtos'];
				$this->stog=$row['stog'];
				$this->guardsex=$row['guardsex'];
				$this->studsex=$row['studsex'];
			}
			$result->free();
		}
// Class relation ends
	}

?>